

This subdirectory contains the tutorial on how to implement the full model in OpenBUGS.  It also contains a 
data_sandbox subsubdirectory that has the procedure to create the simulated data used in the tutorial.

You will want to review the video for the full model if you want to replicate our analyses, or if you want
to use the model for persuasion in small groups in your own research.  

If you are new to OpenBUGS, or if you need a refresher, you should first watch the tutorial video on how
to implement a basic model in OpenBUGS.  The examples in this intro tutorial are not related to the paper but 
are only meant to give you skills on how to implement a model and use the software.  If you plan to use our 
model or any computational Bayesian model, we strongly recommend that you read one or more books on Bayesian 
inference (such as the McElreath book) and/or collaborate with someone with a background in Bayesian statistics. 

The introductory tutorial video can be found at, https://youtu.be/_44_RXTWpRw

Once you feel comfortable using OpenBUGS you should then proceed next to the fullmodel examples.  The video 
explaining how to implement the full model can be found at, can be found at https://youtu.be/IlO990AKurI

We provide several flexible models: one for the linear outcomes case, one for the dichotomous case, and one for the 
ordinal outcomes case.  The models we incude here are general to different sample sizes and different numbers of 
questions (you should have at least three pre-post questions in order to identify the latent persuasion random effect), 
and for the ordinal case you also can specify the number of response categories which for a Likert scale is usually 
either 5 or 7 (the number of response categories must be more than 3 or the code will break; the code will need to be 
modified if you have fewer than 4 categories).

Finally we note that it is essential to review the continuous fullmodel tutorial and model that is in this subdirectory
to see how the OpenBUGS model notation matches the notation we use in the paper.  The replication materials for 
our application rely on notation from a previous version of the paper so you need to first use the tutorial model 
to see the correspondence with the paper, and then you can see how notation corresponds to the application
replication since the models are exactly the same structure (i.e., only the notation differs).  Most users presumably
will want to use the model for their own data and so the model in the fullmodel subdirectories is the only one
of interest.  

The Stata commands to create the simulated data are in the generatedata.do file, but be sure not to
run the file and overwrite the distribution simulated data because you'll get different results.  Note there
are four cases for the regression.  The first case models the latent index as a continuous outcome variable and 
uses the true values for all random effect variables; the second case is for the continuous outcome case and uses the
estimated values for the random effect variables; the third models the ordinal version of the outcome with true
random effects; and the fourth case models the ordinal outcome version with estimated random effects.  Note that in
both cases the coefficients are smaller in the estimated than the true cases due to the presence of measurement
error (a well-known result from measurement error in the explanatory variables).  And note too that the parameters
are about 50 percent larger in the ordinal case than the contiuous case since the scale of the DV changes when 
converting from the contiuous latent index to the observed categorical outcomes.

